package cn.test;

import cn.thread.MyThread;
import cn.thread.MyYield;
//yield测试
public class ThreadYield {
    public static void main(String[] args) {
        MyThread myThread=new MyThread();
        MyYield myYield=new MyYield();
        myThread.setName("普通线程:");
        myYield.setName("Yield:");
        myThread.setPriority(7);//设置优先级让效果明显
        myThread.start();
        myYield.start();
    }
}
